/*

Author   : chaos

FileName : fun_arr.cpp

Date     : 09/08/17 10:47:21

*/
#include <iostream>
using namespace std;

int array_sum(int* ,int);
int main(void)
{
    int array[3] = {1,2,3};

    cout << "The sum of array element is " << array_sum(array,3) << "." << endl;

    return 0;
}

int array_sum(int *ptr_to_array,int size)
{
    int sum = 0;

    for (int i = 0; i < size; i++) {
        sum += ptr_to_array[i];

    }
    return sum;
}
